<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" >
    $(function(){
	    $("div").attr("title","你是测试么").addClass("current")
	})
</script>
<style>
div.current( background:red ;)

</style>
</head>

<body>
 <div> 测试2 </div>
</body>
</html>
